package com.aaronprj.common.entities.mbooks;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;

@Entity
@NamedQueries( {
		@NamedQuery(name = "Message.findBySender", query = "SELECT e FROM Message e WHERE e.senderId = :senderId"),
		@NamedQuery(name = "Message.findByRecieverId", query = "SELECT e FROM Message e WHERE e.recieverId = :recieverId")})
public class Message {

	private int id;
	private int senderId;
	private String senderName;
	private int recieverId;
	private String content;
	private boolean unreaded;
	private Date createDate;

	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public int getSenderId() {
		return senderId;
	}
	public void setSenderId(int senderId) {
		this.senderId = senderId;
	}
	public String getSenderName() {
		return senderName;
	}
	public void setSenderName(String senderName) {
		this.senderName = senderName;
	}
	public int getRecieverId() {
		return recieverId;
	}
	public void setRecieverId(int recieverId) {
		this.recieverId = recieverId;
	}
	@Column(length=4000)
	public String getContent() {
		return content;
	}
	public void setContent(String content) {
		this.content = content;
	}
	
	public boolean isUnreaded() {
		return unreaded;
	}
	public void setUnreaded(boolean unreaded) {
		this.unreaded = unreaded;
	}
	public Date getCreateDate() {
		return createDate;
	}
	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}
	
	
	
}
